package A1_3;

import java.util.ArrayList;
import java.util.List;

public class Student {
    private String name;
    private List<Subject> enrolledSubjects;

    public Student(String name) {
        this.name = name;
        this.enrolledSubjects = new ArrayList<>();
    }

    public void addEnrolledSubject(Subject subject) {
        if (enrolledSubjects.size() < 5) { // A student can enroll in 1-5 subjects
            enrolledSubjects.add(subject);
        } else {
            System.out.println("A student can only enroll in up to 5 subjects.");
        }
    }

    public List<Subject> getEnrolledSubjects() {
        return enrolledSubjects;
    }

    public String getName() {
        return name;
    }
}